import { MockMethod } from 'vite-plugin-mock';
import { mock } from 'mockjs';
import { resultSuccess } from '../_util';

const albumList = mock({
  'data|30': [
    {
      id: '@increment',
      name: '@cname(6)',
      cateId: '@integer(0,1)',
      cateName: '@ctitle(6)',
      imgUrl: '@image("1200x800", "#fa541c")',
      createTime: '@date(yyyy-MM-dd HH:mm:ss)',
    },
  ],
});

export default [
  {
    url: '/mock-api/v1/shop/album/page',
    method: 'post',
    response: () => {
      return resultSuccess({ list: albumList.data.slice(0, 18), total: 40 });
    },
  },
] as MockMethod[];
